import request from '@/utils/request'

export function addHotel(data) {
  return request({
    url: `hotel`,
    method: 'post',
    data
  })
}

export function addHotelRoom(data) {
  return request({
    url: `hotel/room`,
    method: 'post',
    data
  })
}

export function updateHotel(data) {
  return request({
    url: `hotel`,
    method: 'put',
    data
  })
}

export function updateHotelHtml(id, data) {
  return request({
    url: `hotel/${id}/html`,
    method: 'post',
    data
  })
}

export function updateRoom(data) {
  return request({
    url: `hotel/room`,
    method: 'put',
    data
  })
}

export function queryAllHotelsByTheme(themeId, pageNum = 1) {
  return request({
    url: `hotel/theme/${themeId}/page/${pageNum}`,
    method: 'get'
  })
}

export function queryHotelById(id) {
  return request({
    url: `hotel/${id}`,
    method: 'get'
  })
}

export function queryRoomByHotel(id) {
  return request({
    url: `hotel/${id}/room`,
    method: 'get'
  })
}

export function queryAllHotelTheme() {
  return request({
    url: 'hotel/theme',
    method: 'get'
  })
}

export function queryBedAndBreakfast() {
  return request({
    url: 'hotel/breakfast',
    method: 'get'
  })
}
